package control;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import javax.swing.JButton;
import javax.swing.JComboBox;

import model.ProxyEvent;
import utils.DataWriter;

public class FilterListener implements ActionListener {

	private ProxyEvent event;
	private JComboBox<String> filter;
	private JButton button = new JButton();

	public FilterListener(ProxyEvent event, JComboBox<String> place) {
		this.event = event;
		this.filter = place;

	}

	@Override
	public void actionPerformed(ActionEvent e) {

		Object src = e.getSource();
		if (src.getClass().equals(button.getClass())) {
			new DataWriter(event);
		}
		event.setFilter(filter.getSelectedItem().toString());

	}

}
